<?php
/**
 * @category   Swishe
 * @package    Swishe_Search_Interface
 * @copyright  Copyright (c) 2009 David L Norris (http://code.google.com/p/sws)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
interface Swishe_Search_Interface
{
    
    /**
     * Set query string
     *
     * @param string $query
     * @throws Swishe_Search_Exception
     */
    public static function setQuery(string $query);
    
    /**
     * Set structure (which parts of an HTML document to search)
     *
     * @param Swishe_Search_Swishe_Structure $structure
     * @throws Swishe_Search_Exception
     */
    public static function setStructure(Swishe_Search_Swishe_Structure $structure);
       
    /**
     * Set phrase delimeter
     *
     * @param string $char
     * @throws Swishe_Search_Exception
     */
    public static function setPhraseDelimiter(string $char);
    
    /**
     * Set search limit
     *
     * @param string $property
     * @param string $low
     * @param string $high
     * @throws Swishe_Search_Exception
     */
    public static function setSearchLimit(string $property, string $low, string $high);
    
    /**
     * Get search limit
     *
     * Returns array with low and high keys and values
     *
     * @param string $property
     * @return array
     * @throws Swishe_Search_Exception
     */
    public static function getSearchLimit(string $property);

    /**
     * Remove search limit
     *
     * @param string $property
     * @throws Swishe_Search_Exception
     */
    public static function removeSearchLimit(string $property);
    
    /**
     * Remove all search limits
     *
     * @throws Swishe_Search_Exception
     */
    public static function resetSearchLimit();

    /**
     * Adds a property to the sort list
     *
     * @param string $property
     * @param boolean $ascending
     * @throws Swishe_Search_Exception
     */
    public static function setSort(string $property, boolean $ascending);
    
    /**
     * Remove sorting rules
     *
     * @param string $property
     * @throws Swishe_Search_Exception
     */
    public static function resetSort();
    
    /**
     * Execute query
     *
     * Returns a results object
     *
     * @param string $query
     * @return Swishe_Search_Results 
     * @throws Swishe_Search_Exception
     */
    public static function execute(string $query);
    
}